package com.pfsoft.mybatisplusgradle.controller;

import com.pfsoft.mybatisplusgradle.domain.TbOrderInfo;
import com.pfsoft.mybatisplusgradle.service.IOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author pengfei
 * @date 2022年06月28日 11:27
 */
@RestController
public class OrderInfoController {
    @Autowired
    private IOrderInfoService orderInfoService;

    @GetMapping("/orders")
    public List<TbOrderInfo> getAll(){
        return orderInfoService.getAll();
    }

    @PostMapping("orders")
    public int  save(@RequestBody TbOrderInfo tbOrderInfo){
        return orderInfoService.save(tbOrderInfo);
    }
}
